[mv]
definition="drive"
numbervars=0
minvars=0
help="This is a name substitution for the drive command - all variables are passed on"
 
[ct]
definition="count"
numbervars=0
minvars=0
help="This is a name substitution for the count command"

[showlat]
definition="comment "a=@(alat)       b=@(blat)      c=@(clat)<CR_LF>alpha=@(alpha)  beta=@(beta)  gamma=@(gamma)""
numbervars=0
minvars=0
help="This gives information about the lattice constants"

[nosetpos]
definition="zero %1 @(%1.zero)+@(%1)-%2"
numbervars=2
minvars=2
help="The setpos alias sets the zero of the specified motor so that the current position reads the specified value. Syntax: setpos motor_name value"


[scanpars]
definition="comment "   Center of Mass = @(com)+/-@(com_error)<CR_LF>   Full Width     = @(fwhm)+/-@(fwhm_error)<CR_LF>   Sum of Counts  = @(sum)+/-@(sum_error)" title="Parameters of last scan""
numbervars=0
minvars=0
help="Displays parameters of last scan"

[com]
definition="drive %1 @(com)"
numbervars=1
minvars=1
help="drive the specified motor to the center of mass for the last scan"

[spos]
definition="method %1 set_motor_position d %2+@(%1.zero)"
numbervars=2
minvars=2
help="Sets the current position"

[center]
definition="scan %1 @(%1)-%2 @(%1)+2% 3%; drive %1 @(com)"
numbervars=3
minvars=3
help="This scans a specified motor by +/-1 in steps of 0.1 and then moves to the center of mass"


[driverel]
definition="drive %1 @(%1)+%2"
numbervars=2
minvars=2
help="Do a relative drive"

[scanrel]
definition="scan %1 @(%1)+%2 @(%1)+%3 %4; drive %1 @(%1)-%3"
numbervars=4
minvars=4
help="Do a relative scan using the default preset.  Eg. scanrel s1 -1 1 .1"

[br]
definition="drive h %1 k %2 l %3"
numbervars=3
minvars=3
help="Drive to a Bragg position.  Eg. br 1 1 1"

[th2th]
definition="scan 2theta @(2theta)+%1 @(2theta)+%2 %3 omega @(omega)+(%1/2) @(omega)+(%2/2) %3/2; drive omega @(omega)-((@(2theta)-@(COM))/2) 2theta @(COM)"
numbervars=3
minvars=3
help="Do a relative theta-2theta scan.  Eg. th2th -1 1 .1 "

[th2th_v2]
definition="scan 2theta @(2theta)+%1 @(2theta)+%2 %3 omega @(omega)+(%1/2) @(omega)+(%2/2) %3/2; drive omega @(omega)-%2/2 2theta @(2theta)-%2"
numbervars=3
minvars=3
help="Do a relative theta-2theta scan.  Eg. th2th -1 1 .1 " 

[nth2th]
definition="scan 2theta @(2theta)+%1 @(2theta)+%2 %3 omega @(omega)-(%1/2) @(omega)-(%2/2) %3/2; drive omega @(omega)+((@(2theta)-@(COM))/2) 2theta @(COM)"
numbervars=3
minvars=3
help="Do a relative theta-2theta scan.  Eg. th2th -1 1 .1"

[mcu]
definition="logfileoutput off; method mcu set_scale_factor d %1; logfileoutput on; comment "The monitor count unit was set to @(methodreal0)" title "Setting the monitor count unit""
numbervars=1
minvars=1
help="Set the monitor count unit.  Eg. mcu 100000"

[init]
definition=initialize
numbervars=0
minvars=0
help="Initialize hardware and software"

[set_temp340]
definition="method temp340 set_setpoint d %1"
numbervars=1
minvars=1
help="Set the Lakeshore 340 temperature setpoint"

[find_home]
definition="home"
numbervars=0
minvars=0
help="This is a name substitution for the home command - all variables are passed on" 

[scon]
definition="preset time; scancon %1 %2 %3 %4 %5"
numbervars=5
minvars=5
help="Do a relative continuous scan using the default preset.  Eg. scon phi 0 180 .25 .25"

[sconrel]
definition="preset time; scancon %1 @(%1)+%2 @(%1)+%3 %4 %5"
numbervars=5
minvars=5
help="Do a relative continuous scan using the default preset.  Eg. sconrel phi -1 1 .1 1"

[ccenter]
definition="scanrel %1 @(%1)+%2 @(%1)+%3 %4; drive %1 @(com)"
numbervars=4
minvars=4
help="This scans a specified motor by +/-1 in steps of 0.1 and then moves to the center of mass; ccenter phi -1 1 0.1 "

[pksearch]
definition="preset time; scantitle "2theta=@(2theta) chi=@(chi)"; scon phi %1 %2 %3 %4; drive chi @(chi)+%5; scantitle "2theta=@(2theta) chi=@(chi)"; scon phi %2 %1 %3 %4; ; drive chi @(chi)+%5"
numbervars=5
minvars=5
help="pksearch 0 180 0.25 0.25 5"

[pkcenter]
definition="scantitle " Centering  peak ( @(h) @(k) @(l) ) T=@(t340_sample.position)";  scanrel omega -%1 %1 %2; drive omega @(com); scanrel chi -%3 %3 %4; drive chi @(com); th2th -%5 %5 %6; scantitle "Centered Peak ( @(h) @(k) @(l) ) @(2theta) @(omega) @(chi) @(phi)""
numbervars=6
minvars=6
help="pkcenter 2 .2  4 0.4 3 0.3"

[pkcenterstep]
definition="preset monitor %1; scantitle " Centering  peak ( @(h) @(k) @(l) ) T=@(tsample.position)";  th2th -%2 %2 %3;  scan omega @(omega)-%4 @(omega)+4% 5%; drive omega @(com); scan chi @(chi)-%6 @(chi)+6% 7%; drive chi @(com); scantitle "Stepcentering Peak ( @(h) @(k) @(l) ) @(2theta) @(omega) @(chi) @(phi)";"
numbervars=7
minvars=7
help="pkcenterstep 2 3 0.3  2 0.2 4 0.4"


[coll]
definition="br %1 %2 %3 ; scantitle "( @(h) @(k) @(l) ) T=@(tsample.position) marc@(marc) m1@(m1) mb@(mbend)"; scanrel omega -%4 %4 %5"
numbervars=5
minvars=5
help="coll 1 1 0 2 0.1"

[mvlambda1.003]
definition="scantitle "wavelength 1.003 11500 counts/sec for mbend=280"; drive marc -0.53; drive m1 -25.87;"
numbervars=0
minvars=0
help="mvlambda1.000"

[mvlambda1.5424]
definition="scantitle "wavelength 1.5424 102500 counts/sec for mbend=300"; drive marc -0.18; drive m1 -39.17;"
numbervars=0
minvars=0
help="mvlambda1.536"

[mvlambda2.541]
definition="scantitle "wavelength 2.541 9000 counts/sec for mbend=300"; drive marc -1.03; drive m1 -3.9;"
numbervars=0
minvars=0
help="mvlambda2.540"

[backhome]
definition="mv 2theta 60 omega 20 chi 0 phi 0"
numbervars=0
minvars=0
help="mv 2theta 50 omega 0 chi 0 phi 0"

[readpid]
definition="logfileoutput off; method lakeshore_340_temperature_controller write_then_read s "PID?1"; logfileoutput on; comment "PID Settings: @(methodstr0)" title "Read PID Values""
numbervars=0
minvars=0
help="Read lakeshore PID settings"

[readramp]
definition="logfileoutput off; method lakeshore_340_temperature_controller write_then_read s "RAMP?1"; logfileoutput on; comment "RAMP Settings: @(methodstr0)" title "Read RAMP settings""
numbervars=0
minvars=0
help="Read lakeshore RAMP parameters"

[setpid]
definition="logfileoutput off; method lakeshore_340_temperature_controller send_command s "PID 1,%1 %2 %3"; method lakeshore_340_temperature_controller write_then_read s "PID?1"; logfileoutput on; comment "Setting PID parameters to: %1, %2, %3 <CR_LF>Returned PID Settings: @(methodstr0)" title "Set PID Values""
numbervars=3
minvars=3
help="Set lakeshore PID settings"

[setramp]
definition="logfileoutput off; method lakeshore_340_temperature_controller send_command s "RAMP 1, 1, %1"; method lakeshore_340_temperature_controller write_then_read s "RAMP?1"; logfileoutput on; comment "Setting RAMP rate to: %1 <CR_LF>Returned Ramp Settings: @(methodstr0)" title "Set RAMP rate""
numbervars=1
minvars=1
help="Set lakeshore RAMP rate"

[heater1_on]
definition="method lakeshore_336_temperature_controller send_command s "RANGE 1,3""
numbervars=0
minvars=0
help="Turn on Lakeshore heater HIGH"

[heater2_on]
definition="method lakeshore_336_temperature_controller send_command s "RANGE 2,3""
numbervars=0
minvars=0
help="Turn on Lakeshore heater HIGH"

[waitpost]
definition="waitpos %1 %2-%3 %2+%3 %4 %5"
numbervars=5
minvars=4
help="Do a toleranced waitpos"
